#include <stdio.h>
#include <unistd.h>
#include <string.h>

#define CNT 101
#define STYLE '#'

void process()
{
    char arr[CNT];
    memset(arr, '\0', sizeof(arr));

    const char* str = "/-|\\";
    int i = 0;

    for(i = 0; i < 100; i++)
    {
        arr[i] = STYLE;
        printf("\033[47;31m[%-100s]\033[0m [%d%%] %c\r", arr, i + 1, str[i % 4]);
        fflush(stdout);
        usleep(20000);
    }

    printf("\n");
}

int main()
{
    process();

    return 0;
}
